package com.haois.mp.database.module.common.service;


import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.haois.mp.database.module.common.daomain.UserToken;
import com.haois.mp.database.module.basic.service.IBasicService;

import java.util.List;

public interface IUserTokenService extends IBasicService<UserToken, String> {

    UserToken findByUserId(String userId, String sysType);

    UserToken findByOpenId(String openId, String sysType);

    UserToken findByAccessToken(String accessToken, String sysType);

    void deleteByAccessToken(String accessToken, String sysType);

    void deleteByOpenId(String openId, String sysType);

    void deleteByUserId(String userId, String sysType);

    void logout(String openId, String sysType, String reason);

    void saveUserTokenHis(UserToken userToken, String reason, String sysType);

    List<UserToken> findAllByAccessToken(String accessToken, String sysType);

    void login(UserToken userToken);

    void login(UserToken userToken, WxMaUserInfo maUserInfo);

    void updateInfo(UserToken userToken);

    void updateInfo(UserToken userToken,WxMaUserInfo maUserInfo);

    List<UserToken> find(UserToken userToken);


}
